﻿@model EOS.EntWebDemo.Models.Leave.LinkPageView

    @{
        ViewBag.Title = "请假流程管理";
        Layout = "~/Views/Shared/_Layout.cshtml";
    }

    <html>
    <head>
        <meta name="viewport" content="width=device-width" />
        <title>Create</title>

        <script src="../../Content/jquery-easyui-1.5.2/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                var pageInfoID = $("#pageNameList").val();
                $('#PageInfoID').val(pageInfoID);

                GetPageUrl();
                $("#LeaveStepName").attr("readonly", true)
                $("#PageUrl").attr("readonly", true)

                $("#pageNameList").change(function () {
                    var pageInfoID = $("#pageNameList").val();
                    $('#PageInfoID').val(pageInfoID);
                    GetPageUrl();
                })
            })

            //下拉框联动绑定PageUrl
            function GetPageUrl() {
                $("#PageUrl").empty();
                $.get(
                "/LeaveSteps/GetPageUrl",
                { id: $("#pageNameList").val() },
                function (data, state) {
                    $('#PageUrl').val(data);
                });
            }
        </script>
    </head>
    <body>
        @using (Html.BeginForm())
        {
            @Html.AntiForgeryToken()

            <div class="form-horizontal">
                <h4>绑定页面设置</h4>
                <hr />

                @Html.ValidationSummary(true, "", new { @class = "text-danger" })

                <div class="form-group">
                    @Html.HiddenFor(model => model.LeaveStepID)
                    @Html.HiddenFor(model => model.PageInfoID)

                    @Html.Label("步骤名称", htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EditorFor(model => model.LeaveStepName, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.LeaveStepName, "", new { @class = "text-danger" })
                    </div>

                    @Html.Label("页面处理区分", htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EditorFor(model => model.ReturnKBN, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.ReturnKBN, "", new { @class = "text-danger" })
                    </div>

                    @Html.Label("页面名称", htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.DropDownList("pageNameList", ViewBag.pageNameList as IEnumerable<SelectListItem>, new { @class = "dropdown-toggle form-control" })
                    </div>

                    @Html.Label("页面URL", htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EditorFor(model => model.PageUrl, new { htmlAttributes = new { @class = "form-control", @readyOnly = "readyOnly" } })
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-2">
                    </div>
                    <div class="col-md-10">
                        <input type="submit" value="保存" class="btn btn-default" />
                    </div>
                    <div>
                        @Html.ActionLink("返回上级页面", "LinkPage", new { id = Model.LeaveStepID })
                    </div>
                </div>

            </div>
        }

    </body>
</html>
